package 补充数组;

public class 输出数组最小值 {
    public static void main(String[] args) {
        int[] a = new int[5];
        a[0] = (int) (Math.random() * 100);
        a[1] = (int) (Math.random() * 100);
        a[2] = (int) (Math.random() * 100);
        a[3] = (int) (Math.random() * 100);
        a[4] = (int) (Math.random() * 100);

        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }     //此代码输出该数组所有内容
        int temp = 1000;
        for (int i = 0; i < a.length; i++) {
            if (a[i] < temp) {
                temp = a[i];
            }
        }
        System.out.println(temp);


    }

}

